home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1988 August
/
1988-08.d64
/
bb editor
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
136 lines
10 rem copyright 1988 compute! publications, inc. - all rights reserved
20 ifa=0thena=1:load"bb",8,1
30 poke51,0:poke52,32:poke55,0:poke56,32:clr
40 print"[147] copyright 1988 compute! pub., inc."
50 printtab(11)"all rights reserved":fori=1to1500:next
60 dimc%(255),c2(24),x(15),y(15)
70 fori=4to16:readc2(i):next
80 data1,1,1,1,1,1,3,4,5,6,7,8,9
90 fori=0to63:poke960+i,0:next
100 fori=0to23step3:reada:poke960+i,a:next
110 data255,129,129,129,129,129,129,255
120 fori=0to5:reada:h(i)=a:c%(a+128)=1:next:c%(32)=1
130 data32,81,64,93,77,78
140 fori=48to53:c%(i)=2:next
150 x(5)=1:x(6)=1:x(7)=1:x(9)=-1:x(10)=-1:x(11)=-1
160 y(10)=-1:y(14)=-1:y(6)=-1:y(9)=1:y(13)=1:y(5)=1
170 u$=chr$(145):d$=chr$(17):r$=chr$(29):l$=chr$(157):c$=chr$(147)+d$+d$
180 c%(145)=-14:c%(17)=-13:c%(29)=-7:c%(157)=-11
190 h$=chr$(159)+chr$(19)+d$+d$+d$+d$+d$
200 fori=1to5:reada:c%(a)=1:h$=h$+chr$(a)+d$+l$:next
210 data209,192,221,205,206
220 fori=3to10:reada$:c%(asc(a$))=i:h$=h$+a$+d$+l$:next
230 datap,s,l,c,m,o,h,e
240 c%(13)=11
250 x=0:y=4:ch=h(1):us=51957
260 j=56320:v=53248:pokev+21,1:pokev+39,7:pokev+23,0:pokev+29,0:poke2040,15
270 gosub560
280 pokev+1,y*8+50:t=x*8+24:ift>255thenpokev+16,1:goto300
290 pokev+16,0
300 pokev,255andt
310 a=0:t=peek(j):f=16andt:jy=15andt
320 iff=16then380
330 ifxthen360
340 a=c2(y):ifa=1thena$=chr$(h(y-4))
350 goto430
360 s=y*40+x+1024:t=ch:ifpeek(s)=chthent=32
370 pokes,t:ifmfthengosub580
380 dx=x(jy):dy=y(jy):ifdxordythen530
390 geta$
400 a=c%(asc(a$+"@")):ifa=0then310
410 ifa<0thendx=x(-a):dy=y(-a):goto530
420 ifa>2thenpoke53269,0
430 onagoto450,500,650,660,760,820,840,850,1150,1330,1340
440 goto310
450 s=x+y*40+1024:ch=asc(a$)-128:t=ch:ift<0thent=t+128:ch=t
460 ifx=0then310
470 ifpeek(s)=chthent=32
480 pokes,t:ifmfthengosub580
490 goto310
500 s=x+y*40+1024:ch=h(val(a$)):ifx=0then310
510 t=ch:pokes,t:ifmfthengosub580
520 goto310
530 y=y+dy:x=x+dx:ify<0ory>24theny=y-dy
540 ifx>38orx<0thenx=x-dx
550 goto280
560 poke53281,15:printc$:poke53281,0:printh$:sys49161
570 poke1584,13+mf*128:poke53269,1:return
580 x1=39-x:y1=24-y
590 s1=x1+y1*40+1024:pokes1,t
600 ift=77thent=78:goto620
610 ift=78thent=77
620 s1=x1+y*40+1024:pokes1,t
630 s1=x+y1*40+1024:pokes1,t
640 return
650 sys49155:clr:goto60
660 sys49158:printc$"save screen to disk"
670 ea=peek(253)+peek(254)*256+1:sa=us+13
680 he=int(ea/256):le=ea-he*256:hs=int(sa/256):ls=sa-hs*256
690 input"enter filename ";f$:iff$=""thenprint"aborted":goto740
700 open1,8,1,f$:poke193,ls:poke194,hs
710 poke174,le:poke175,he
720 sys62957:close1
730 print"save complete"
740 fori=1to999:next
750 gosub560:goto310
760 printc$"load screen from disk"
770 input"enter filename ";f$:iff$=""thenprint"aborted":goto810
780 open1,8,0,f$:poke185,1:poke780,0
790 sys65493:close1
800 print"load complete"
810 gosub560:goto310
820 poke53281,15:printc$h$:poke53281,0:x=0:y=4:ch=h(1)
830 poke1584,13+mf*128:goto280
840 mf=1-mf:poke1584,13+mf*128:goto310
850 sys49158:printc$" options and colors [146]"
860 m$="background":t=0:mn=0:mx=15
870 gosub1110:ba=t
880 m$="border":t=11:gosub1110:pokeus+7,t
890 m$="puck color":t=14:gosub1110:pokeus+8,t
900 m$="bb color":t=15:gosub1110:pokeus+6,t*16+ba
910 m$="right gun color":t=1:gosub1110:pokeus+9,t*16+ba
920 m$="left gun color":t=1:gosub1110:pokeus+5,t*16+ba
930 m$="goals needed to win":t=7:mn=1:gosub1110:pokeus+2,t
940 print"how many seconds until destruct mode?"
950 m$="(-1 for no destruct)":t=60:mn=-1:mx=900:gosub1110
960 ift<0thenpokeus+3,255:goto980
970 se=t*60:t1=int(se/256):pokeus+3,t1:t2=256-se+t1*256:pokeus+4,t2
980 m$="friction: 1=on, 0=off":t=1:mn=0:mx=1:gosub1110:pokeus+10,t
990 print"choose 0 for shared bb's"
1000 m$=" 1 for possessive":t=0:gosub1110:pokeus+12,t
1010 print"maximum number of bb's in play"
1020 m$=" ":t=100:mn=10:mx=250:gosub1110:pokeus-1,t+3
1030 m$="rapid fire delay":mn=1:mx=100:t=7:gosub1110:pokeus+11,t
1040 print:print"save new version to disk (y/n)?"
1050 geta$:ifa$="n"then1100
1060 ifa$<>"y"then1050
1070 fori=us+13to53248
1080 ifpeek(i)=255thensa=49152:ea=i+1:i=53248
1090 next:goto680
1100 gosub560:goto310
1110 printm$" "t;
1120 fori=0tolen(str$(t))+1:printl$;:next:inputu
1130 ifu<mnoru>mxthenprintu$;:printm$"("mn"-"mx") "t;:goto1120
1140 t=u:return
1150 sys49158:pokev+21,0:printc$tab(11)" command summary"
1160 print:print" the first five menu items change the"
1170 print" deflector type."
1180 print:print" the letter commands are:"
1190 print" p - play with current settings"
1200 print" s - save a screen to disk"
1210 print" l - load a screen from disk"
1220 print" c - clear screen of any barriers"
1230 print" m - toggle symmetry mode"
1240 print" o - choose options"
1250 print" h - show help screen"
1260 print" e - exit the program"
1270 print: print" commands can be invoked by pressing"
1280 print" that key, or by moving the cursor over"
1290 print" and pressing the fire button."
1300 print:print tab(8)" space bar to continue "
1310 geta$:ifa$<>" "then1310
1320 goto260
1330 poke53269,0:printchr$(147):end
1340 ifx=0thenf=0:goto340
1350 goto310